//这里只暴漏模块方法，使用需要在相应router上注册
var shopModole = require("../../../models").shop;
exports.openShop = function (req, res) {
    var shop = new shopModole(req.body);
    shopModole.findOne({name:req.body.name})
    .exec(function (err, user) {
        if (err)
            return res.json({err:err});
        if (user) {
            return res.json({err:"用户名已经存在"});
        }
        shop.save(function (err, user) {
            if (err) {
                return res.json({err:err});
            }
            res.json({
            	success:true
            });
        });
    });
};
